/**
 * 获取地址栏参数
 * @param event
 * @returns
 */
function getLocationUrl(event){
	var page_url=event.target.baseURI;
	if(page_url==undefined){
		page_url=window.location;
	}
	return page_url;
}
var all_e=null;
function goTo(page,con) {
	showLoading();
	window.location=page;
}
function goTo2(page,con) {
	showLoading();
	window.location=page;
}
/**
 * 
 * @param param
 * @param url
 * @returns {Boolean}
 */
function getParameterByName(param, url) { 
	var match = RegExp('[?&]' + param + '=([^&]*)').exec(url);  
	return match && decodeURIComponent(match[1].replace(/\+/g, ' '));  
}

/**
 * 获取地址拦里的参数
 * @param name
 * @returns
 */
function getQueryString(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
	var r = window.location.search.substr(1).match(reg);
	if (r != null) return unescape(r[2]); return null;
}
/**
 * 校验对象是否是空
 * @param obj
 * @returns {Boolean}
 */
function isNullOrEmpty(obj){
	if(obj==undefined || obj==null || obj=="" )
		return true;
	return false;
}
var rootPath="";

var access_token="";//页面访问标识
var pageNo="1";//页面初始页码
var pageSize="10";//页面初始加载数据量
var totalPage="0";//总页数
var type = "";//操作类型
var workConType=null;//日志类型
var thisWorkConType=null;//从前一页面传递的当前日志类型

//花的几种状态
var flower_bloom= "/images/weixin/flower/flower_bloom.gif";//盛开的
var flower_die= "/images/weixin/flower/flower_die.gif";//死掉的
var flower_droop= "/images/weixin/flower/flower_droop.gif";//枯萎的
//一般状态的花
var flower_= "/images/weixin/flower/flower.png";
//默认头像图片
var defaultHeadPic="/images/weixin/default.png";
//系统头像图片
var systemHeadPic="/images/weixin/system.jpg";
//积分的几种状态
var integral_up= "/images/weixin/flower/up.png";
var integral_parallel= "/images/weixin/flower/parallel.png";
var integral_down= "/images/weixin/flower/down.png";

//listtable style
var comStyle='style="padding-left: 60px; " ';
var imgStyle='style=" max-height: 40px;max-width: 40px; " ';
var sideStyle='style="font-size: 12px;" ';
var margin_top_no='style="margin-top:0px;width: 80%;" ';
var margin_top_6='style="margin-top:6px" ';

function p_show(obj){
	var c = $(obj).css("white-space");
	if(c == 'normal'){
		$(obj).css({"white-space":"nowrap"});
	}else{
		$(obj).css({"white-space":"normal"});
	}
}

/******************************滑动加载刷新数据公用块***start***************************************/
///**
// * 下拉刷新 （自定义实现此方法）
// * myScroll.refresh();		// 数据加载完成后，调用界面更新方法
// */
//function pullDownAction1 () {
//	setTimeout(function () {	// <-- Simulate network congestion, remove setTimeout from production!
//		pageNo=1;
//		loadData(true);
////		myScroll.refresh();		//数据加载完成后，调用界面更新方法   Remember to refresh when contents are loaded (ie: on ajax completion)
//	}, 1000);	// <-- Simulate network congestion, remove setTimeout from production!
//}
//
///**
// * 滚动翻页 （自定义实现此方法）
// * myScroll.refresh();		// 数据加载完成后，调用界面更新方法
// */
//function pullUpAction1 () {
//	setTimeout(function () {	// <-- Simulate network congestion, remove setTimeout from production!
//		pageNo++;
//		loadData();
////		myScroll.refresh();		// 数据加载完成后，调用界面更新方法 Remember to refresh when contents are loaded (ie: on ajax completion)
//	}, 1000);	// <-- Simulate network congestion, remove setTimeout from production!
//}

var myScroll,
pullDownEl, pullDownOffset,
pullUpEl, pullUpOffset,
generatedCount = 0;

var pullDownAction_new=function(){alert("asdf");myScroll.refresh();};//向下滑动事件
var pullUpAction_new=function(){myScroll.refresh();};//向上滑动事件
var scrollArea_ObjIdName="wrapper";//滑动域id
var pullUpLabelId="pullUpLabel";//向上滑动显示文本区域的Id
var pullDownLabelId="pullDownLabel";//向下滑动显示文本区域的Id
var pullDownId="pullDown";//向下滑动显示提示的区域Id
var pullUpId="pullUp";//向上滑动示提示的区域Id
/**
 * 初始化iScroll控件
 * @param p_scrollAreaId
 * @param p_pullUpLabelId
 * @param p_pullDownLabelId
 * @param p_pullUpId
 * @param p_pullDownId
 * @param p_pullUpAction
 * @param p_pullDownAction
 */
function scrollPlugLoaded(p_scrollAreaId,
		p_pullUpLabelId,p_pullDownLabelId,
		p_pullUpId,p_pullDownId,
		p_pullUpAction,p_pullDownAction) {
//	var selectFlag="#";//标识查找元素对象时是Id选择器，还是类选择器
	if(myScroll!=null){
		myScroll.destroy();
	}
	if(!isNullOrEmpty(p_scrollAreaId))
		scrollArea_ObjIdName=scrollAreaId;
	
	if(!isNullOrEmpty(p_pullUpLabelId))
		pullUpLabelId=p_pullUpLabelId;
	
	if(!isNullOrEmpty(p_pullDownLabelId))
		pullDownLabelId=p_pullDownLabelId;
	
	if(!isNullOrEmpty(p_pullUpId))
		pullUpId=p_pullUpId;
	
	if(!isNullOrEmpty(p_pullDownId))
		pullDownId=p_pullDownId;
	
	if(!isNullOrEmpty(p_pullUpAction))
		pullUpAction_new=p_pullUpAction;
	
	if(!isNullOrEmpty(p_pullDownAction))
		pullDownAction_new=p_pullDownAction;
		
	pullDownEl = document.getElementById(pullDownId);
	pullDownOffset = pullDownEl.offsetHeight;
	pullUpEl = document.getElementById(pullUpId);	
	pullUpOffset = pullUpEl.offsetHeight;
	
	myScroll = new iScroll(scrollArea_ObjIdName, {
		scrollbarClass: 'myScrollbar', /* 重要样式 */
		useTransition: false, /* 此属性不知用意，本人从true改为false */
		topOffset: pullDownOffset,
		onRefresh: function () {
			if (pullDownEl.className.match('loading')) {
				pullDownEl.className = '';
				document.getElementById(pullDownLabelId).innerHTML = '下拉刷新...';
			} else if (pullUpEl.className.match('loading')) {
				pullUpEl.className = '';
				document.getElementById(pullUpLabelId).innerHTML = '上拉加载更多...';
			}
		},
		onScrollMove: function () {
			console.log("this.y"+this.y+";this.minScrollY:"+this.minScrollY+";this.maxScrollY"+this.maxScrollY);
			if (this.y>0 && this.y > 5 && !pullDownEl.className.match('flip')) {
				pullDownEl.className = 'flip';
				document.getElementById(pullDownLabelId).innerHTML = '松手开始刷新...';
				this.minScrollY = 0;
			} else if (this.y>0 && this.y < 5 && pullDownEl.className.match('flip')) {
				pullDownEl.className = '';
				document.getElementById(pullDownLabelId).innerHTML = '下拉刷新...';
				this.minScrollY = -pullDownOffset;
			} else if (this.y<0 && this.y < (this.maxScrollY - 5) && !pullUpEl.className.match('flip')) {
				pullUpEl.className = 'flip';
				document.getElementById(pullUpLabelId).innerHTML = '松手开始加载更多...';
				this.maxScrollY = this.maxScrollY;
			} else if (this.y<0 && this.y > (this.maxScrollY + 5) && pullUpEl.className.match('flip')) {
				pullUpEl.className = '';
				document.getElementById(pullUpLabelId).innerHTML = '上拉加载更多...';
				this.maxScrollY = pullUpOffset;
			}
		},
		onScrollEnd: function () {
			if (pullDownEl.className.match('flip')) {
				pullDownEl.className = 'loading';
				document.getElementById(pullDownLabelId).innerHTML = '加载中...';				
				pullDownAction_new();	// Execute custom function (ajax call?)
			} else if (pullUpEl.className.match('flip')) {
				pullUpEl.className = 'loading';
				document.getElementById(pullUpLabelId).innerHTML = '加载中...';				
				pullUpAction_new();	// Execute custom function (ajax call?)
			}
		}
	});
	
	setTimeout(function () { document.getElementById(scrollArea_ObjIdName).style.left = '0'; }, 800);
}
/**
 * 初始化iScroll控件(封装最完善的一版，请使用本方法)
 * @param p_scrollAreaId
 * @param p_pullUpAction
 * @param p_pullDownAction
 * $("#wrapper_redFlowerRank  #pullDown") 
 * replace
 * obj.querySelector('#pullDown');
 */
function scrollPlugLoadedOfReturn(p_scrollAreaId,
		p_pullUpAction,p_pullDownAction) {
	
//	var obj= document.getElementById(p_scrollAreaId);
	var pullDownEl=$("#"+p_scrollAreaId+"  #pullDown");//obj.querySelector('#pullDown');
	var pullUpEl =$("#"+p_scrollAreaId+"  #pullUp");//obj.querySelector('#pullUp');
	
	var pullDownOffset = pullDownEl.offsetHeight;
	var pullUpOffset = pullUpEl.offsetHeight;
	
	var scrollPlug = new iScroll(p_scrollAreaId, {
		scrollbarClass: 'myScrollbar', /* 重要样式 */
		useTransition: false, /* 此属性不知用意，本人从true改为false */
		topOffset: pullDownOffset,
		vScrollbar:false,//隐藏垂直方向上的滚动条
		onRefresh: function () {
			var obj= document.getElementById(p_scrollAreaId);
			var pullDownEl=$("#"+p_scrollAreaId+"  #pullDown");//obj.querySelector('#pullDown');
			var pullUpEl =$("#"+p_scrollAreaId+"  #pullUp");//obj.querySelector('#pullUp');
			var down=$("#"+p_scrollAreaId+"  #pullDown").attr("class");
			var up=$("#"+p_scrollAreaId+"  #pullUp").attr("class");
			if (down!=undefined && down.match('loading')) {
				$("#"+p_scrollAreaId+"  #pullDown").removeClass();//pullDownEl.className = '';
				$("#"+p_scrollAreaId+"  .pullDownLabel").html("下拉刷新...");//pullDownEl.querySelector('.pullDownLabel').innerHTML = '下拉刷新...';
//				pullDownEl.hide();
			} else if (up!=undefined && up.match('loading')) {
				$("#"+p_scrollAreaId+"  #pullUp").removeClass();//pullUpEl.className = '';
				$("#"+p_scrollAreaId+"  .pullUpLabel").html("上拉加载更多...");//pullUpEl.querySelector('.pullUpLabel').innerHTML = '上拉加载更多...';
//				pullUpEl.hide();
//				this.maxScrollY = this.maxScrollY;
			}
		},
		onScrollMove: function () {
			var obj= document.getElementById(p_scrollAreaId);
			var pullDownEl=$("#"+p_scrollAreaId+"  #pullDown");//obj.querySelector('#pullDown');
			var pullUpEl =$("#"+p_scrollAreaId+"  #pullUp");//obj.querySelector('#pullUp');
			var down=$("#"+p_scrollAreaId+"  #pullDown").attr("class");
			var up=$("#"+p_scrollAreaId+"  #pullUp").attr("class");
//			var listVal=54;
//			var srollVal=listVal+15;
			var srollVal=5;
			 if (this.y>0 && this.y > srollVal && (down==undefined ||  !down.match('flip') ) ) {
				$("#"+p_scrollAreaId+"  #pullDown").addClass("flip");//pullDownEl.className = 'flip';
				$("#"+p_scrollAreaId+"  .pullDownLabel").html("松手开始刷新...");//pullDownEl.querySelector('.pullDownLabel').innerHTML = '松手开始刷新...';
				this.minScrollY = 0;
			} else if (this.y>0 && this.y < srollVal && down!=undefined && down.match('flip')) {
				$("#"+p_scrollAreaId+"  #pullDown").removeClass();//pullDownEl.className = '';
				$("#"+p_scrollAreaId+"  .pullDownLabel").html("下拉刷新...");//pullDownEl.querySelector('.pullDownLabel').innerHTML = '下拉刷新...';
				this.minScrollY = -pullDownOffset;
			} else if (this.y<0 && this.y < (this.maxScrollY - srollVal) &&  (up==undefined ||  !up.match('flip')) ) {
				$("#"+p_scrollAreaId+"  #pullUp").addClass("flip");//pullUpEl.className = 'flip';
				$("#"+p_scrollAreaId+"  .pullUpLabel").html("松手开始加载更多...");//pullUpEl.querySelector('.pullUpLabel').innerHTML = '松手开始加载更多...';
				this.maxScrollY = this.maxScrollY;
			} else if (this.y<0 && this.y > (this.maxScrollY + srollVal) && up!=undefined && up.match('flip')) {
				$("#"+p_scrollAreaId+"  #pullUp").removeClass();//pullUpEl.className = '';
				$("#"+p_scrollAreaId+"  .pullUpLabel").html("上拉加载更多...");//pullUpEl.querySelector('.pullUpLabel').innerHTML = '上拉加载更多...';
				this.maxScrollY = pullUpOffset;
			}
//			else if(this.y > listVal && this.y < srollVal && pullDownEl.css("display")=="none"){
//				pullDownEl.show();
//			}else if( this.y < (this.maxScrollY - listVal) && this.y > (this.maxScrollY - srollVal)  && pullUpEl.css("display")=="none" ){
//				pullUpEl.show();
//			}
		},
		onScrollEnd: function () {
			var obj= document.getElementById(p_scrollAreaId);
			var pullDownEl=$("#"+p_scrollAreaId+"  #pullDown");//obj.querySelector('#pullDown');
			var pullUpEl =$("#"+p_scrollAreaId+"  #pullUp");//obj.querySelector('#pullUp');
			var down=$("#"+p_scrollAreaId+"  #pullDown").attr("class");
			var up=$("#"+p_scrollAreaId+"  #pullUp").attr("class");
			if (down!=undefined && down.match('flip')) {
				$("#"+p_scrollAreaId+"  #pullDown").addClass("loading");//pullDownEl.className = 'loading';
				$("#"+p_scrollAreaId+"  .pullDownLabel").html("加载中...");//pullDownEl.querySelector('.pullDownLabel').innerHTML = '加载中...';
				p_pullDownAction();	// Execute custom function (ajax call?)
			} else if (up!=undefined && up.match('flip')) {
				$("#"+p_scrollAreaId+"  #pullUp").addClass("loading");//pullUpEl.className = 'loading';
				$("#"+p_scrollAreaId+"  .pullUpLabel").html("加载中...");//pullUpEl.querySelector('.pullUpLabel').innerHTML = '加载中...';
				p_pullUpAction();	// Execute custom function (ajax call?)
			}
		}
	});
	
	setTimeout(function () { document.getElementById(p_scrollAreaId).style.left = '0'; }, 800);
	
	return scrollPlug;
}


/**
 * 初始化iScroll控件(在封装最完善的代码基础上，将向下滑动的刷新改为加载上一页信息。
 * 									向上滑动到3页的整倍数时，清空前两页的数据)
 * @param p_scrollAreaId
 * @param p_pullUpAction
 * @param p_pullDownAction
 * $("#wrapper_redFlowerRank  #pullDown") 
 * replace
 * obj.querySelector('#pullDown');
 */
function scrollPlugLoadedOfReturn_new(p_scrollAreaId,
		p_pullUpAction,p_pullDownAction) {
	
//	var obj= document.getElementById(p_scrollAreaId);
	var pullDownEl=$("#"+p_scrollAreaId+"  #pullDown");//obj.querySelector('#pullDown');
	var pullUpEl =$("#"+p_scrollAreaId+"  #pullUp");//obj.querySelector('#pullUp');
	
	var pullDownOffset = pullDownEl.offsetHeight;
	var pullUpOffset = pullUpEl.offsetHeight;
	
	var scrollPlug = new iScroll(p_scrollAreaId, {
		scrollbarClass: 'myScrollbar', /* 重要样式 */
		useTransition: false, /* 此属性不知用意，本人从true改为false */
		topOffset: pullDownOffset,
		vScrollbar:false,//隐藏垂直方向上的滚动条
		onRefresh: function () {
			var obj= document.getElementById(p_scrollAreaId);
			var pullDownEl=$("#"+p_scrollAreaId+"  #pullDown");//obj.querySelector('#pullDown');
			var pullUpEl =$("#"+p_scrollAreaId+"  #pullUp");//obj.querySelector('#pullUp');
			var down=$("#"+p_scrollAreaId+"  #pullDown").attr("class");
			var up=$("#"+p_scrollAreaId+"  #pullUp").attr("class");
//			console.log("onrefresh:"+down);
			if (down!=undefined && down.match('loading')) {
				$("#"+p_scrollAreaId+"  #pullDown").removeClass();//pullDownEl.className = '';
				$("#"+p_scrollAreaId+"  .pullDownLabel").html("下拉显示上一页...");//pullDownEl.querySelector('.pullDownLabel').innerHTML = '下拉刷新...';
			} else if (up!=undefined && up.match('loading')) {
				$("#wrapper_redFlowerRank").css("bottom","0px");
				$("#"+p_scrollAreaId+"  #pullUp").removeClass();//pullUpEl.className = '';
				$("#"+p_scrollAreaId+"  .pullUpLabel").html("上拉加载更多...");//pullUpEl.querySelector('.pullUpLabel').innerHTML = '上拉加载更多...';
			}
		},
		onScrollMove: function () {
			var pullDownEl=$("#"+p_scrollAreaId+"  #pullDown");//obj.querySelector('#pullDown');
			var pullUpEl =$("#"+p_scrollAreaId+"  #pullUp");//obj.querySelector('#pullUp');
			var down=$("#"+p_scrollAreaId+"  #pullDown").attr("class");
			var up=$("#"+p_scrollAreaId+"  #pullUp").attr("class");
//			var listVal=5;
//			var srollVal=listVal+15;
			var srollVal=15;
			 if (this.y>0 && this.y > srollVal && (down==undefined ||  down==null ||  down=="" ) ) {
				$("#"+p_scrollAreaId+"  #pullDown").addClass("flip");//pullDownEl.className = 'flip';
				$("#"+p_scrollAreaId+"  .pullDownLabel").html("松手开始加载...");//pullDownEl.querySelector('.pullDownLabel').innerHTML = '松手开始刷新...';
				this.minScrollY = 0;
			} else if (this.y>0 && this.y < srollVal && down!=undefined && down=='flip' ) {
//				$("#"+p_scrollAreaId+"  #pullDown").removeClass();//pullDownEl.className = '';
//				$("#"+p_scrollAreaId+"  .pullDownLabel").html("下拉显示上一页...");//pullDownEl.querySelector('.pullDownLabel').innerHTML = '下拉刷新...';
				this.minScrollY = -pullDownOffset;
			} else if (this.y<0 && this.y < (this.maxScrollY - srollVal) &&  (up==undefined ||  !up.match('flip')) ) {
				$("#"+p_scrollAreaId+"  #pullUp").addClass("flip");//pullUpEl.className = 'flip';
				$("#"+p_scrollAreaId+"  .pullUpLabel").html("松手开始加载更多...");//pullUpEl.querySelector('.pullUpLabel').innerHTML = '松手开始加载更多...';
				this.maxScrollY = this.maxScrollY;
			} else if (this.y<0 && this.y > (this.maxScrollY + srollVal) && up!=undefined && up.match('flip')) {
				$("#"+p_scrollAreaId+"  #pullUp").removeClass();//pullUpEl.className = '';
				$("#"+p_scrollAreaId+"  .pullUpLabel").html("上拉加载更多...");//pullUpEl.querySelector('.pullUpLabel').innerHTML = '上拉加载更多...';
				this.maxScrollY = pullUpOffset;
			}
			else if(this.y > 0 && this.y < srollVal && pullDownEl.css("display")=="none"){
				pullDownEl.show();
			}
//			else if( this.y < (this.maxScrollY - listVal) && this.y > (this.maxScrollY - srollVal)  && pullUpEl.css("display")=="none" ){
//				pullUpEl.show();
//			}
		},
		onScrollEnd: function () {
			var pullDownEl=$("#"+p_scrollAreaId+"  #pullDown");//obj.querySelector('#pullDown');
			var pullUpEl =$("#"+p_scrollAreaId+"  #pullUp");//obj.querySelector('#pullUp');
			var down=$("#"+p_scrollAreaId+"  #pullDown").attr("class");
			var up=$("#"+p_scrollAreaId+"  #pullUp").attr("class");
//			console.log(down);
			if (down!=undefined && down.match('flip')) {
				$("#"+p_scrollAreaId+"  #pullDown").removeClass().addClass("loading");//pullDownEl.className = 'loading';
				$("#"+p_scrollAreaId+"  .pullDownLabel").html("加载中...");//pullDownEl.querySelector('.pullDownLabel').innerHTML = '加载中...';
				p_pullDownAction();	// Execute custom function (ajax call?)
			} else if (up!=undefined && up.match('flip')) {
				$("#"+p_scrollAreaId+"  #pullUp").removeClass().addClass("loading");//pullUpEl.className = 'loading';
				$("#"+p_scrollAreaId+"  .pullUpLabel").html("加载中...");//pullUpEl.querySelector('.pullUpLabel').innerHTML = '加载中...';
				p_pullUpAction();	// Execute custom function (ajax call?)
			}
		}
	});
	
	setTimeout(function () { document.getElementById(p_scrollAreaId).style.left = '0'; }, 800);
	
	return scrollPlug;
}


/**
 * 初始化iScroll控件
 * scrollArea_ObjIdName :'wrapper'
 * pullDownAction_new :下拉刷新
 * pullUpAction_new :上拉加载
 */
var myScroll2,
pullDownEl2, pullDownOffset2,
pullUpEl2, pullUpOffset2,
generatedCount2 = 0;
function scrollPlugLoaded2(scrollArea_ObjIdName,pullDownAction,pullUpAction) {
	if(myScroll2!=null){
		myScroll2.destroy();
	}
	pullDownEl2 = document.getElementById('pullDown2');
	pullDownOffset2 = pullDownEl2.offsetHeight;
	pullUpEl2 = document.getElementById('pullUp2');	
	pullUpOffset2 = pullUpEl2.offsetHeight;
//	alert(scrollArea_ObjIdName);
	myScroll2 = new iScroll(scrollArea_ObjIdName, {
		scrollbarClass: 'myScrollbar', /* 重要样式 */
		useTransition: false, /* 此属性不知用意，本人从true改为false */
		topOffset: pullDownOffset2,
		onRefresh: function () {
			if (pullDownEl2.className.match('loading')) {
				pullDownEl2.className = '';
				pullDownEl2.querySelector('.pullDownLabel2').innerHTML = '下拉刷新...';
			} else if (pullUpEl2.className.match('loading')) {
				pullUpEl2.className = '';
				pullUpEl2.querySelector('.pullUpLabel2').innerHTML = '上拉加载更多...';
			}
		},
		onScrollMove: function () {
			if (this.y > 5 && !pullDownEl2.className.match('flip')) {
				pullDownEl2.className = 'flip';
				pullDownEl2.querySelector('.pullDownLabel2').innerHTML = '松手开始刷新...';
				this.minScrollY = 0;
			} else if (this.y < 5 && pullDownEl2.className.match('flip')) {
				pullDownEl2.className = '';
				pullDownEl2.querySelector('.pullDownLabel2').innerHTML = '下拉刷新...';
				this.minScrollY = -pullDownOffset2;
			} else if (this.y < (this.maxScrollY - 5) && !pullUpEl2.className.match('flip')) {
				pullUpEl2.className = 'flip';
				pullUpEl2.querySelector('.pullUpLabel2').innerHTML = '松手开始加载更多..';
				this.maxScrollY = this.maxScrollY;
			} else if (this.y > (this.maxScrollY + 5) && pullUpEl2.className.match('flip')) {
				pullUpEl2.className = '';
				pullUpEl2.querySelector('.pullUpLabel2').innerHTML = '上拉加载更多...';
				this.maxScrollY = pullUpOffset;
			}
		},
		onScrollEnd: function () {
			if (pullDownEl2.className.match('flip')) {
				pullDownEl2.className = 'loading';
				pullDownEl2.querySelector('.pullDownLabel2').innerHTML = '加载中...';				
				pullDownAction();	// Execute custom function (ajax call?)
			} else if (pullUpEl2.className.match('flip')) {
				pullUpEl2.className = 'loading';
				pullUpEl2.querySelector('.pullUpLabel2').innerHTML = '加载中...';				
				pullUpAction();	// Execute custom function (ajax call?)
			}
		}
	});
	
	setTimeout(function () { document.getElementById(scrollArea_ObjIdName).style.left = '0'; }, 800);
}

//初始化绑定iScroll控件 
//document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
//document.addEventListener('DOMContentLoaded', scrollPlugLoaded, false); 
/******************************滑动加载刷新数据公用块***end***************************************/

/******************************页面公用提示框****start****************************/
/**
 * @param type :success fail
 * @param msg: 提示信息
 */
function alert_wx(type,msg,time){
	type=type==undefined? 'fail':type;
	msg=msg==undefined? '提交失败！':msg;
	time=time==undefined? 3000 :time;
	$.lt_alert({
		type: type,
		right_close:true,
		timeout:time,
		content: msg
	});
};
function alertSuccess_wx(){
	$.lt_alert({
		type: 'success',
		right_close:true,
		content: '提交成功！'
	});
};
function alertFail_wx(){
	$.lt_alert({
		type: 'fail',
		right_close:true,
		content: '提交失败！'
	});
};
function alertException_wx(){
	$.lt_alert({
		type: 'fail',
		right_close:true,
		content: '网络异常！'
	});
};
/******************************页面公用提示框****end****************************/
/******************页面footer button 切换 start***********************/
$( document ).on( "click", "#btn_span_myReview", function( event ) {
	goTo(rootPath+"/jsp/weixin/myReview.jsp?access_token="+access_token);
});
$( document ).on( "click", "#btn_span_myEndPlate", function( event ) {
	goTo(rootPath+"/jsp/weixin/myEndPlate.jsp?access_token="+access_token);
});
$( document ).on( "click", "#btn_span_myInfo", function( event ) {
	goTo(rootPath+"/jsp/weixin/myInfo.jsp?access_token="+access_token);
});

$( document ).on( "click", "#btn_span_redFlowerRank", function( event ) {
	goTo(rootPath+"/jsp/weixin/redFlowerRank.jsp?access_token="+access_token);
});
$( document ).on( "click", "#btn_span_sendFlowerRank", function( event ) {
	goTo(rootPath+"/jsp/weixin/sendFlowerRank.jsp?access_token="+access_token);
});
$( document ).on( "click", "#btn_span_progressRank", function( event ) {
	goTo(rootPath+"/jsp/weixin/progressRank.jsp?access_token="+access_token);
});
$( document ).on( "click", "#btn_span_IntegralRank", function( event ) {
	goTo(rootPath+"/jsp/weixin/integralRank.jsp?access_token="+access_token);
});

function loadRankFunction(){
//	$( document ).on( "click", "#btn_span_redFlowerRank", function( event ) {
//	goTo(rootPath+"/jsp/weixin/redFlowerRank.jsp?access_token="+access_token);
//});
//$( document ).on( "click", "#btn_span_sendFlowerRank", function( event ) {
//	goTo(rootPath+"/jsp/weixin/sendFlowerRank.jsp?access_token="+access_token);
//});
//$( document ).on( "click", "#btn_span_progressRank", function( event ) {
//	goTo(rootPath+"/jsp/weixin/progressRank.jsp?access_token="+access_token);
//});
//$( document ).on( "click", "#btn_span_IntegralRank", function( event ) {
//	goTo(rootPath+"/jsp/weixin/integralRank.jsp?access_token="+access_token);
//});
	$( "#btn_span_redFlowerRank" ).on( "click",function( event ) {
		goTo(rootPath+"/jsp/weixin/redFlowerRank.jsp?access_token="+access_token);
	});
	$( "#btn_span_sendFlowerRank" ).on( "click", function( event ) {
		goTo(rootPath+"/jsp/weixin/sendFlowerRank.jsp?access_token="+access_token);
	});
	$( "#btn_span_progressRank" ).on( "click",function( event ) {
		goTo(rootPath+"/jsp/weixin/progressRank.jsp?access_token="+access_token);
	});
	$( "#btn_span_IntegralRank" ).on( "click", function( event ) {
		goTo(rootPath+"/jsp/weixin/integralRank.jsp?access_token="+access_token);
	});
}
function goTo_redFlowerRank(){
	goTo(rootPath+"/jsp/weixin/redFlowerRank.jsp?access_token="+access_token);
}
function goTo_sendFlowerRank(){
	goTo(rootPath+"/jsp/weixin/sendFlowerRank.jsp?access_token="+access_token);
}
function goTo_progressRank(){
	goTo(rootPath+"/jsp/weixin/progressRank.jsp?access_token="+access_token);
}
function goTo_IntegralRank(){
	goTo(rootPath+"/jsp/weixin/integralRank.jsp?access_token="+access_token);
}

/******************页面footer button 切换 end***********************/

/**************隐藏网页右上角的按钮*****************/
document.addEventListener('WeixinJSBridgeReady', 
		function onBridgeReady() { 
	WeixinJSBridge.call('hideToolbar'); 
	WeixinJSBridge.call('hideOptionMenu'); 
});

function hideWXToolBar(){
	try{
		WeixinJSBridge.call('hideToolbar'); 
	}catch(e){
		console.log("WeixinJSBridge is null");
	}
}